#ifndef _INCLUDES_
#define _INCLUDES_
#include <boost/filesystem/operations.hpp>
#include <QtGui/QApplication>

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <cstdlib>
#include <map>
#endif

#include "vars.h"

using namespace boost;
using namespace std;

namespace bf = boost::filesystem;

#ifndef RULE_H
#define RULE_H

namespace Org
{
    struct Release
    {
        int id;
        string catno;
        string artist;
        string title;
        string format;
    };
    struct Label
    {
        string image;
        string name;
        string contact;
        string profile;
        string url;
        vector<Release> releases;
    };

    struct Artist
    {
        string image;
        string name;
        string url;
        vector<Release> releases;
    };


    struct RuleGroup
    {
        int id;
        string name;
        string description;
        string author;
        int rules; // number of rules
        int rating;
        int downloads;

    };

    class Node
    {
    public:
        Node();
        bool deleteNode();
        bool editNode();
        bool createChild();
        bool hasChildren();
        bool is_connector;

        vector<Node> child_nodes;

        Vars::e_node_type node_type;
        Vars::e_operation operation;

        // search stuff if condition
        string search_term;
        string search_in;
        string search_regex;
        Vars::e_search_type search_type;

        string node_name;

        bool operator==(Node);
        bool operator!=(Node);
    };

    class Condition : public Node
    {
        /*public:
            string search_term;
            string search_in;
            string search_regex;
            string type;
            string node_name;*/
    };

    class Connector : public Node
    {
    public:string connector_type;

    };

    class Rule
    {
    public:

        Rule();
        Rule(string);
        ~Rule();

        int id;
        bool enabled;
        string rule_name;
        string discogs_lookup; // eg. label/Def+Recordings
        Vars::e_action action; // COPY, MOVE, etc        
        bf::path to_dir;
        Node *root_node;

        bool operator==(Rule);
        bool operator!=(Rule);
    };
}

#endif // RULE_H
